<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Insert Function creater</title>
<script type="text/javascript">
<!--


function searchMethod(){<br />
<br />
	document.form1.action.value="search";
	//alert(document.form1.action.value);<br />
<br />
	return true;
<br />
<br />}<br />
function loadMethod(){<br />
<br />
	document.form1.action.value="load";
	return true;
<br />
<br />}<br />
function isExistMethod(){<br />
<br />
	document.form1.action.value="isExist";
	return true;
<br />
<br />}<br />

function phpClassMethod(){<br />
<br />
	document.form1.action.value="PhpClass";
	return true;
<br />
<br />}<br />
function helpCode(){<br />
<br />
	document.form1.action.value="helpCode";
	return true;
<br />
<br />}<br />

function insertMethod(){<br />
<br />
	document.form1.action.value="insertMethod";
	return true;
<br />
<br />}<br />

function updateMethod(){<br />
<br />
	document.form1.action.value="updateMethod";
	return true;
<br />
<br />}<br />
function deleteMethod(){<br />
<br />
	document.form1.action.value="deleteMethod";
	return true;
<br />
<br />}<br />



//-->
</script>
<style type="text/css">
<!--
.sp {<br />
<br />
	font-weight: bold;
	color: #F00;
<br />
<br />}<br />
-->
</style>
</head>

<body>
<div align="center">
<form action="InfoRecompose.php" method="post" name="form1" target="_blank" id="form1">

<input name="tableSize" type="hidden" value="<{$tableSize}>" />
<{foreach from=$tables name=ta item=tab}>
<hr />

<table width="100%" border="1">
  <tr>
    <td width="50%" align="right">Table Name:<span class="sp"><{$tab->tableName}></span></td>
    <td width="50%" align="left">Alias Name:<span class="sp"><{$tab->aliasName}></span></td>
    </tr>
</table>

  <input name="tableName<{$smarty.foreach.ta.index}>" type="hidden" value="<{$tab->tableName}>" />
  <input name="aliasName<{$smarty.foreach.ta.index}>" type="hidden" value="<{$tab->aliasName}>" />
  <input name="columnSize<{$smarty.foreach.ta.index}>" type="hidden" value="<{$tab->columnSize}>" />
 
  

<table  border="1" width="100%">
  <tr align="center">
    <td width="100" align="center">Field</td>
    <td width="100" align="center">Type</td>
    <td width="100" align="center">Null</td>
    <td width="100" align="center">Key</td>
    <td width="100" align="center">attribute name</td>
    <td width="100" align="center">Extra</td>
    <td width="100" align="center">Need Load</td>
    </tr>
  
  <{foreach from=$tab->data item=oneFild name=foo}>
  <input name="extra<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>" type="hidden" value="<{$oneFild->Extra}>" />
  <input name="newType<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>" type="hidden" value="<{$oneFild->newType}>" />
  <input name="newTypeSize<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>" type="hidden" value="<{$oneFild->newTypeSize}>" />
   <input name="field<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>" type="hidden" value="<{$oneFild->newField}>" />
  <tr bgcolor="<{if ($smarty.foreach.foo.index %2==0)}>#99FF00 <{else}>#CC99FF<{/if}>">
    <td>&nbsp;<{$oneFild->Field}></td>
    <td>&nbsp;<{$oneFild->newType}>:<{$oneFild->newTypeSize}></td>
    <td>&nbsp;<{$oneFild->Null}></td>
    <td>&nbsp;<{$oneFild->Key}></td>
    <td>&nbsp;
      <input name="attribute<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>" type="text" value="<{$oneFild->attribute}>"/></td>
    <td>&nbsp;<{$oneFild->Extra}></td>
    <td><label>
      <input type="checkbox" name="need<{$smarty.foreach.ta.index}>_<{$smarty.foreach.foo.index}>" value='<{$oneFild->attribute}>' id='need<{$smarty.foreach.foo.index}>' checked="checked"  />
    </label></td>   
    </tr>
  <{/foreach}>
</table>
<br />
Defined Table Name:<input name="definedTableName<{$smarty.foreach.ta.index}>" type="text" value="_<{$tab->tableName|strtoupper}>_TABLE_NAME" size="40" />
<{/foreach}>




  <label>
    Class Name:<input name="className"  size="34" type="text" id="className" value="DataClass<{foreach from=$tables name=ta item=tab}>_<{if $tab->aliasName!=""}><{$tab->aliasName}><{else}><{$tab->tableName}><{/if}><{/foreach}>" />
  </label>
  


  <label>DB Class Path:
    <input name="dbClassPath" type="text" id="DB Class Path:" value="__PROJECT_ROOT . &quot;/configs/Mysql.class.php&quot;" size="90" />
  </label>
Sql part:
  <label>
      <input name="joinSql" type="text" id="joinSql" value="<{$fromStr|escape}>" size="170" />
    
  </label>

<input name="" type="submit" value="Submit" />
</form>
</div>
<br />
<br /></body>
</html>
